from likeshop_api_project.api.login_api import login_model
from likeshop_api_project.base.myBase import Tools


class setdefault_model(Tools):
    path = '/api/user_address/setdefault'

    def setdefault_action(self,id, hd):
        mydata = {
            "id":id
        }
        print(self.hosturl + self.path)
        res = self.huihua.post(url=self.hosturl + self.path, data=mydata, headers=hd)
        return res.json()


import requests

s = requests.session()
login = login_model(huihua=s)
msg = login.login_action(account='17612345678', pwd='admin123', client='4')
print(msg)
tokena = msg['data']['token']
hd = {
    'token': tokena
}
print(hd)
setdefault = setdefault_model(huihua=s)

msg2 = setdefault.setdefault_action(id=835, hd=hd)
print(msg2)
